package com.controller;

import com.service.ShowDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "测试server接口" , tags = "测试server接口")
@CrossOrigin/*允许跨域请求*/
@RestController
@RequestMapping("test")
public class ServerTestShowDataOne {
    @Autowired
    private ShowDataService showDataService;

    @ApiOperation(value = "get显示主数据库的数据")
    @GetMapping("showMasteAll")
    public String  intoServerOne() {
        StringBuilder strBui = new StringBuilder();
        strBui.append(showDataService.showMasterData());
        return strBui.toString();
    }

    @ApiOperation(value = "post显示从数据库的数据")
    @GetMapping("showSlaveAll")
    public String  intoServerTwo() {
        StringBuilder strBui = new StringBuilder();
        strBui.append(showDataService.showSlaveData());
        return strBui.toString();
    }
}
